class Solution {
public:
    void moveZeroes(vector<int>& nums) {
        int n = nums.size(), fast = 0, slow = 0;
        while (fast < n)
        {
            if (nums[fast])
            {
                swap(nums[slow], nums[fast]);
                slow++;
            }
            fast++;
        }
    }
};